extends Node2D


@onready var data_management = $data_management as DataManagement


#============================================================
#  内置
#============================================================
func _ready():
	data_management.set_property(PropertyConsts.HEALTH, 10)
	# 连接属性发生改变信号
	data_management.property_changed.connect(_property_changed)


#============================================================
#  连接信号
#============================================================
func _on_add_buff_pressed():
	# 火焰魔法BUFF 数据
	data_management.add_property(FireBuff.NAME, {
		FireBuff.BuffParamConsts.DURATION: 1,		# 持续时间
		FireBuff.BuffParamConsts.DAMAGE: 1,			# 造成伤害
	})


func _property_changed(property, previous, current):
	if property == PropertyConsts.HEALTH:
		print("> 生命值发生改变，当前生命值：", current)
